package queue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:周次煜
 * Date: 2024-03-31
 * Time：22:12
 */
public class TestQueue {
    public static void main(String[] args) {
        IQueue iq=new MyQueue();
        iq.offer(5);
        iq.offer(6);
        iq.offer(7);
        iq.offer(8);


        System.out.println("=========出队列=========");
        System.out.println(iq.remove());  // 5
        System.out.println(iq.remove());  // 6




        System.out.println("=========获取对头元素========");

        System.out.println(iq.peek());  // 7
        System.out.println(iq.peek());  // 7



        System.out.println("==========获取队列大小=========");

        System.out.println(iq.size());

        System.out.println("=======判断队列是否为空=======");
        if (iq.isEmpty()) {
            System.out.println("队列为空！");
        } else {
            System.out.println("队列不为空！");
        }
    }
}
